gdk/gdkarrayimpl.c: Fix build on Visual Studio
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 24 Jul 2020 08:25:24 +0000 (16:25 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 24 Jul 2020 08:25:24 +0000 (16:25 +0800)
It seems like initializing something to an empty array using `{}` is a GCCism,
so just stuff a 0 within the braces to accomplish the same thing.

gdk/gdkarrayimpl.c

index b08b43b2c2716fe093ca00db8b74576034fa635b..6692245aa755e3d2689ec5cbff51f20c9a8ca917 100644 (file)
@@ -73,7 +73,7 @@ gdk_array(init) (GdkArray *self)
   self->end = self->start;
   self->end_allocation = self->start + GDK_ARRAY_PREALLOC;
 #ifdef GDK_ARRAY_NULL_TERMINATED
-  *self->start = *(_T_[1]) {};
+  *self->start = *(_T_[1]) { 0 };
 #endif
 #else
   self->start = NULL;
@@ -165,7 +165,7 @@ gdk_array(reserve) (GdkArray *self,
   if (self->start == NULL)
     {
       self->start = g_new (_T_, new_size);
-      *self->start = *(_T_[1]) {};
+      *self->start = *(_T_[1]) { 0 };
     }
   else
 #endif